package Test;

import static org.junit.Assert.*;

import org.junit.*;

import Spil.*;

public class TestTax {

	private FieldTax taxGold;
	private FieldTax taxCaravan;
	private Player player;

	@Before
	public void setUp() throws Exception {
		this.player = new Player("Anders And", 1);
		this.taxGold = new FieldTax(2000, 0, "Goldmine", 8);;
		this.taxCaravan = new FieldTax(4000, 10, "Caravan", 16);
	}

	@After
	public void tearDown() throws Exception {
		this.player = new Player("Anders And", 1);
	}

	@Test
	public void testLandOnGoldmine() {
		int expected = 30000;
		int actual = this.player.bank.getBalance();
		assertEquals(expected, actual);

		//Perform the action to be tested
		this.taxGold.landOnField(this.player);

		expected = 30000 - 2000;
		actual = this.player.bank.getBalance();
		assertEquals(expected, actual);
	}

	@Test
	public void testLandOnCaravan4000() {
		int expected = 30000;
		int actual = this.player.bank.getBalance();
		assertEquals(expected, actual);

		//Perform the action to be tested
		this.taxCaravan.landOnField(this.player);

		expected = 30000 - 4000;
		actual = this.player.bank.getBalance();
		assertEquals(expected, actual);
	}

	@Test
	public void testLandOnCaravan10pro() {
		int expected = 30000;
		int actual = this.player.bank.getBalance();
		assertEquals(expected, actual);

		//Perform the action to be tested
		this.taxCaravan.landOnField(this.player);

		expected = 30000 - 3000;
		actual = this.player.bank.getBalance();
		assertEquals(expected, actual);
	}

}
